﻿using System;

namespace _27_重写基类的成员_继承与我态
{
    public class Program
    {
        static void Main(string[] args)
        {
            MyTest 调用 = new MyTest();
            调用.Output();
        }
    }

    class MyBase
    {
        public virtual void Output()
        {
            Console.WriteLine("基类的方法被调用。");
        }
    }

    class MyTest:MyBase
    {
        public override void Output()
        {
            base.Output();
            Console.WriteLine("派生类的方法被调用。");

        }

    }
}
